<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改巡视记录')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-ncXunshiLogs-edit" th:object="${ncXunshiLogs}">
		<input id="xsId" name="xsId" th:field="*{xsId}"  type="hidden">
		<div class="form-group" hidden="hidden">
			<label class="col-sm-3 control-label">巡视类型 :鸡舍</label>
			<div class="col-sm-8">
				<input id="xsType" name="xsType" th:field="*{xsType}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group" hidden="hidden" >
			<label class="col-sm-3 control-label">状态:1：待确认2：已确认：</label>
			<div class="col-sm-8">
				<input id="xsStatus" name="xsStatus" th:field="*{xsStatus}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group" hidden="hidden">
			<label class="col-sm-3 control-label">订单id：</label>
			<div class="col-sm-8">
				<input id="orderId" name="orderId" th:field="*{orderId}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label" >鸡舍号：</label>
			<div class="col-sm-8">
				<input id="roomNum" name="roomNum" th:field="*{roomNum}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">存栏数量：</label>
			<div class="col-sm-8">
				<input id="stockAmount" name="stockAmount" th:field="*{stockAmount}" class="form-control" type="number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">巡视数量：</label>
			<div class="col-sm-8">
				<input id="xsAmount" name="xsAmount" th:field="*{xsAmount}" class="form-control" type="number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">巡视人员：</label>
			<div class="col-sm-8">
				<select id="createBy" name="createBy" class="form-control select2-multiple">
					<option th:each="user:${users}" th:value="${user.loginName}" th:text="${user.loginName}" th:field="*{createBy}"></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">巡视时间：</label>
			<div class="col-sm-8">
				<input id="createTime" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" name="createTime" required
					   th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd hh:mm:ss')}" class="form-control"
					   type="text" th:class="time-input">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<textarea rows="4" name="remark" th:field="*{remark}" class="form-control" type="text"></textarea>
			</div>
		</div>
	</form>
</div>
<div th:include="include::footer"></div>
<th:block th:include="include :: select2-js" />

<script type="text/javascript">
	var prefix = ctx + "system/ncXunshiLogs/chicken";
	$("#form-ncXunshiLogs-edit").validate({
        rules: {
            stockAmount: {
                required: true,
                digits: true
            },
            xsAmount: {
                required: true,
                digits: true
            }
        },
        messages: {
            stockAmount: "存栏数必须为正整数",
            xsAmount: "巡视数必须为正整数"
        },
        focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-ncXunshiLogs-edit').serialize());
		}
	}
</script>
</body>
</html>
